package com.blockmeta.bbs.immodule.net.api;

import com.blockmeta.bbs.businesslibrary.net.pojo.BaseCodeResponse;
import com.blockmeta.bbs.businesslibrary.net.pojo.BaseImResponse;
import com.blockmeta.bbs.immodule.bean.databean.F10SearchMoreBean;
import com.blockmeta.bbs.immodule.bean.databean.MarketSearchMoreBean;
import com.blockmeta.bbs.immodule.bean.databean.UserBean;
import com.blockmeta.bbs.immodule.net.pojo.KeyboardCoinAndPairPOJO;
import com.blockmeta.bbs.immodule.net.pojo.SearchCirclesResponse;

import java.util.List;

import io.reactivex.Flowable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @author AirThor
 * @date 2019/4/19.
 */
public class IMNetApi {
    public interface GetFansList{
        /**
         * 获取粉丝列表
         * @param userId uid
         * @return 粉丝列表
         */
        @GET("im/user/fans")
        Flowable<BaseImResponse<Object>> getFansList(@Query("userId") int userId);
    }

    public interface SearchIMUser{
        /**
         * 搜索好友
         * @param body 请求体
         * @return 。
         */
        @POST("im/search/friends")
        Flowable<BaseImResponse<List<UserBean>>> searchFriend(@Body RequestBody body);
    }

    public interface SearchCircles{
        /**
         * 搜索圈子
         * @param name 圈子名字
         * @param pageNum 页码
         * @param pageSize 一页数据数量
         * @return 圈子
         */
        @GET("im/chatGroup/pageByQuery")
        Flowable<BaseCodeResponse<SearchCirclesResponse>> searchCircles(@Query("search_name")String name, @Query("page_num") int pageNum, @Query("page_size") int pageSize);
    }

    public interface ImKeyboardF10{
        /**
         * @see "https://gitee.com/btc8/appserver/wikis/IM?sort_id=1348722#338-%E8%8E%B7%E5%8F%96-f10-%E6%A8%A1%E5%9D%97%E5%88%97%E8%A1%A8-a1imquoteslisttipscoin-get"
         * @return im 键盘F10列表
         */
        @GET("im/quotes/listTipsCoin")
        Flowable<BaseCodeResponse<List<KeyboardCoinAndPairPOJO>>> getKeyboardF10();
    }

    public interface ImKeyboardPair{
        /**
         *
         * @return im 键盘交易对
         */
        @GET("im/quotes/listTipsTradePair")
        Flowable<BaseCodeResponse<List<KeyboardCoinAndPairPOJO>>> getKeyboardPairs();
    }

    public interface F10SearchMore{
        /**
         * 聊天页面分享F10搜索更多
         * @param key 搜索关键字
         * @param page 分页字段
         * @return 搜索结果
         */
        @GET("search/coin")
        Flowable<BaseCodeResponse<F10SearchMoreBean>> f10SearchMore(@Query("key")String key, @Query("page")int page,@Query("count")int count);
    }

    public interface MarketSearchMore{
        /**
         * 聊天页面分享k线搜索更多
         * @param key 关键字
         * @param page 分页字段
         * @return 搜索结果
         */
        @GET("search/pair")
        Flowable<BaseCodeResponse<MarketSearchMoreBean>> marketSearchMore(@Query("key")String key, @Query("page")int page, @Query("count")int count);
    }
}
